﻿<!doctype html>
<html>

<head>
    <title>钉钉登录</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="format-detection" content="telephone=no">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    <script src="/js/umc.js?v.02" type="text/javascript"></script>
    <script src="/UMC.Conf" type="text/javascript"></script>

    <script src="https://g.alicdn.com/dingding/dingtalk-jsapi/2.7.13/dingtalk.open.js"></script>
    <style>
        .weui_msg .weui_msg_title {
            margin-bottom: 5px;
            font-weight: 400;
            font-size: 20px;
        }

        .weui_msg .weui_msg_desc {
            font-size: 14px;
            color: #888;
        }

        .weui_msg {
            padding-top: 36px;
            text-align: center;
        }
    </style>
    <script>dd.ready(function () {
            var qvalue = UMC.query(location.search.substring(1));
            UMC.UI.On("User", function () {
                if (qvalue.oauth_callback) {
                    location.href = v.oauth_callback;
                } else {
                    location.reload(true);
                }
            });
            var corps = {appids};
            var errs = [];
            function permission(i) {
                var index = i || 0;
                if (index < corps.length) {
                    UMC('.weui_msg_desc').text(["正在尝试钉钉应用登录,第", index + 1, "次"].join(''))
                    var corpId = corps[index];
                    dd.runtime.permission.requestAuthCode({
                        corpId: corpId,
                        onFail: function (err) {
                            errs.push(JSON.stringify(err));
                            permission(index + 1);
                        },
                        onSuccess: function (info) {
                            UMC.UI.Command('Account', 'Login', {
                                'type': 'dingtalk',
                                'code': info.code,
                                'appid': corpId,
                                'transfer': qvalue.transfer

                            });
                        }
                    });
                } else {
                    alert("当前域名在钉钉中未授权" + errs.join(','));
                }
            }
            permission(0);

        });</script>

</head>

<body>
    <div ui="main" class="ui">


        <div class="weui_msg">
            <p class="weui_msg_title">
                你正在使用钉钉登录
            </p>
            <div class="weui_icon_area">
                <i class="weui_icon_msg weui_icon_safe_warn">
                    <svg t="1586952211118" class="icon" viewBox="0 0 1024 1024" version="1.1"
                        xmlns="http://www.w3.org/2000/svg" p-id="2196" width="150" height="200">
                        <path
                            d="M944.103234 80.712561 511.903005 0 87.986321 80.712561 50.205399 86.36525l0 521.8123c0 31.293279 7.970562 62.414567 24.00468 93.352866 15.946123 31.032293 36.815975 60.991645 62.620556 90.110044 25.800581 29.070401 55.155966 56.624886 88.00716 82.578458 32.899191 26.00157 66.348351 49.153297 100.451475 69.45518 34.094125 20.341881 66.948318 37.259951 98.602577 50.704211 31.654259 13.44626 59.438731 22.659754 83.401413 27.690477l10.133443 1.873897 11.063392-1.873897c23.357715-5.030723 50.54422-14.244217 81.553515-27.690477 31.013294-13.444261 62.940538-30.36133 95.839729-50.704211 32.858193-20.300883 65.247411-43.45361 97.226653-69.45518 31.927244-25.947573 60.35868-53.508057 85.240312-82.578458 24.881632-29.117399 44.974526-59.076751 60.36268-90.110044 15.342156-30.938298 23.039733-62.059587 23.039733-93.352866l0-521.8133L944.103234 80.712561zM878.856823 618.458985c0 24.080676-5.712686 47.855368-17.232052 71.231082-11.476369 23.416712-26.818525 45.940473-46.076466 67.581283-19.304938 21.681808-41.377724 42.023689-66.395348 60.943648-25.023624 18.920959-51.008195 36.105014-78.057707 51.600162-26.997515 15.490148-54.36701 28.893411-82.064486 40.246786-27.737474 11.348376-53.401063 19.762913-76.997765 25.284609l0-468.612226L143.09329 466.73433 143.09329 137.520436l363.830989-62.996535 5.112719 1.018944 0 391.189485 366.817825 0L878.856823 618.458985 878.856823 618.458985z"
                            p-id="2197" fill="#ffbe00"></path>
                    </svg>
                </i>
            </div>
            <div class="weui_text_area">

                <p class="weui_msg_desc">
                    只有在钉钉环境中，才能正常工作
                </p>
            </div>
        </div>
    </div>
</body>

</html>